import request from '@/api/useRequest'
const publicPath = '/dictType'
// 字典分页请求
export function getPageList(params: {
  page: number,
  pageSize: number
}) {
  return request({
    url: `${publicPath}/getDictTypeList`,
    method: 'get',
    params
  })
}
// 通过字典编码查询字典是否存在
export function findByCode(params: { type_code: string }) {
  return request({
    url: `${publicPath}/findByCode`,
    method: 'get',
    params
  })
}
// 创建字典
export function add(data: {
  type_code: string,
  type_name: string,
  remark: string
}) {
  return request({
    url: `${publicPath}/add`,
    method: 'post',
    useCommonTip: true,
    data
  }  as any )
}
export function del(data: { ids: number[]}) {
  return request({
     url: `${publicPath}/delete`,
    method: 'delete',
    useCommonTip: true,
    data
  } as any)
}